<?php
/**
 * @developer Socheat
 * @copyright 2012
 */
    //select from where to_user
    $mailpath   = "to_user='".$_SESSION['username']."'";
    $email      = new mailUser();
    $email      = $email->getmail($mailpath);
    //$emailgets   = mysql_fetch_assoc($email); 
    
    // for product
    $account = new user_account();
    $account->getting_Id($_SESSION['acc_id']); //for ID user
    
    
    $del=isset($_GET['del'])?$_GET['del']:"";
    if(!empty($del))
    {
        $delete = mysql_query("DELETE FROM contact WHERE email_id=$del");
    }
?>
<link rel="stylesheet" href="http://code.jquery.com/ui/1.9.1/themes/base/jquery-ui.css" />
	<style>
    .toggler
    {
        margin: 10px 0 0 0;
    }
	.button {		
		text-decoration: none;        
	}
    .point
    {
        cursor: pointer;
    }
	#effect {
		position: relative;
		padding: 0.4em;
	}
	h3.statistic {
		margin: 0;
		padding: 0.4em;
		text-align: left;
        font-size: 14px;
        display:block;
	}
    .t_none
    {
        border:none;
    }
    .notread
    {
        color:#000;
        font-weight: bold;
    }
    .read
    {
        color:#999;
        font-weight:normal;
        background:#eee!important;
    }
    a {color:#000;}
    tr:hover
    {
        background: #ddd!important;
    }
	</style>
<div style="margin: 10px 15px 0 0;">
<h3 class="statistic ui-widget-header ui-corner-all"><!--Inbox--><?php echo $lang['SELLERINBOX'];?></h3>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<?php
    while($emailget= mysql_fetch_assoc($email))
    {
        if($emailget['status']==0)
        {
            $status = 'notread';
        } else
        {
            $status = 'read';
        }
        if($emailget['reply']>0)
        {
            $reply = '<i class="icon-share-alt"></i> ';
        }
        else
        {
            $reply = '';
        }
        ?>

    <tr class="<?php echo $status;?>">
    <td style="width: 10px;padding:10px 0"><input type="checkbox" value="<?php echo $emailget['email_id'];?>" /></td>
    <td><?php echo $reply;?><a href="<?php echo W_ROOT;?>/company/action/?p=email/mail&id=<?php echo $emailget['email_id'];?>"><?php echo $account->fname;?></a></td>
    <td><a href="<?php echo W_ROOT;?>/company/action/?p=email/mail&id=<?php echo $emailget['email_id'];?>"><?php echo $emailget['title'];?></a></td>
    <td style="width: 133px;"><a href="<?php echo W_ROOT;?>/company/action/?p=email/mail&id=<?php echo $emailget['email_id'];?>"><?php echo $emailget['added_date'];?></a></td>
    <td style="width: 10px;padding:10px"><a href="<?php echo W_ROOT;?>/company/action/?p=email/index&del=<?php echo $emailget['email_id'];?>"><i class="icon-remove"></i></a></td>
  </tr>
        
        <?php            
    }
?> 
</table>
</div>   